package com.qdu.bussiness.service.impl;

import java.util.List;

import com.qdu.common.utils.id.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qdu.bussiness.mapper.BusCoachMapper;
import com.qdu.bussiness.domain.BusCoach;
import com.qdu.bussiness.service.IBusCoachService;

/**
 * 教练信息Service业务层处理
 * 
 * @author qdu
 * @date 2022-03-09
 */
@Service
public class BusCoachServiceImpl implements IBusCoachService 
{
    @Autowired
    private BusCoachMapper busCoachMapper;

    /**
     * 查询教练信息
     * 
     * @param coachId 教练信息主键
     * @return 教练信息
     */
    @Override
    public BusCoach selectBusCoachByCoachId(Long coachId)
    {
        return busCoachMapper.selectBusCoachByCoachId(coachId);
    }

    /**
     * 查询教练信息列表
     * 
     * @param busCoach 教练信息
     * @return 教练信息
     */
    @Override
    public List<BusCoach> selectBusCoachList(BusCoach busCoach)
    {
        return busCoachMapper.selectBusCoachList(busCoach);
    }

    /**
     * 新增教练信息
     * 
     * @param busCoach 教练信息
     * @return 结果
     */
    @Override
    public int insertBusCoach(BusCoach busCoach)
    {
        busCoach.setCoachId(IdUtil.getId());
        return busCoachMapper.insertBusCoach(busCoach);
    }

    /**
     * 修改教练信息
     * 
     * @param busCoach 教练信息
     * @return 结果
     */
    @Override
    public int updateBusCoach(BusCoach busCoach)
    {
        return busCoachMapper.updateBusCoach(busCoach);
    }

    /**
     * 批量删除教练信息
     * 
     * @param coachIds 需要删除的教练信息主键
     * @return 结果
     */
    @Override
    public int deleteBusCoachByCoachIds(Long[] coachIds)
    {
        return busCoachMapper.deleteBusCoachByCoachIds(coachIds);
    }

    /**
     * 删除教练信息信息
     * 
     * @param coachId 教练信息主键
     * @return 结果
     */
    @Override
    public int deleteBusCoachByCoachId(Long coachId)
    {
        return busCoachMapper.deleteBusCoachByCoachId(coachId);
    }
}
